home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / cli / mx2src.arc / XMODEMT.MOD < prev    next >
Text File  |  1989-01-05  |  2KB  |  53 lines

  1. (*
  2.         1       check xmodem status
  3.         2       change error-check method
  4.         99      abort xmodem
  5. *)
  6. MODULE  xmodemt;
  7. FROM    SYSCALL IMPORT  EnableSpint,DisableSpint;
  8. FROM    GEMDOS  IMPORT  OldTerm,ConOut;
  9. FROM    GEMX    IMPORT  BasePageAddress;
  10. FROM    SYSTEM  IMPORT  ADR,ADDRESS;
  11. FROM    XMODEM  IMPORT  xmodemsnd,xmodemabort,crcmode,xmodemerror,
  12.                         xmodemstat;
  13. VAR     ok                              : BOOLEAN;
  14.         spintcmd                        : ARRAY [0..2] OF LONGCARD;
  15.         cmd                             : ARRAY [0..81] OF CHAR;
  16.         i,delay                         : CARDINAL;
  17.  
  18. PROCEDURE       run;
  19. BEGIN
  20.         IF spintcmd[0]=1 THEN xmodemstat END;
  21.         IF spintcmd[0]=99 THEN xmodemabort:=TRUE END;
  22. END             run;
  23.  
  24. BEGIN
  25.         IF EnableSpint(1,run,ADR(spintcmd)) THEN
  26.            spintcmd[1]:=LONGCARD(xmodemstat);
  27.            crcmode:=TRUE;
  28.            FOR i:=1 TO ORD(BasePageAddress^.CmdLine[0])+1 DO
  29.               cmd[i-1]:=BasePageAddress^.CmdLine[i];
  30.            END;
  31.            cmd[ORD(BasePageAddress^.CmdLine[0])]:=0c;
  32.            IF BasePageAddress^.CmdLine[0]#0c THEN
  33.               IF cmd[0]='-' THEN
  34.                  crcmode:=FALSE;
  35.                  FOR i:=0 TO ORD(BasePageAddress^.CmdLine[0]) DO
  36.                     cmd[i]:=cmd[i+1];
  37.                  END;
  38.               END;
  39.            IF xmodemsnd(cmd) THEN
  40.               ConOut(7c);
  41.            ELSE
  42.               FOR i:=0 TO 3 DO
  43.                  FOR delay:=0 TO 10000 DO END;
  44.                  ConOut(7c);
  45.               END;
  46.            END; (* send the file *)
  47.            END;
  48.            DisableSpint(1);
  49.            OldTerm;
  50.         END;
  51. END     xmodemt.
  52.  
  53.